﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;

namespace TBlog.Web
{
    public class RouteConfig
    {
        public static void RegisterRoutes(RouteCollection routes)
        {
            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");


            routes.MapRoute("退出登陆", "loginout", new { controller = "Manage", action = "LoginOut" });
            routes.MapRoute("验证码", "validate", new { controller = "Manage", action = "GetValidateCode", });
            routes.MapRoute("文章详情", "detail", new { controller = "Home", action = "Detail" });
            routes.MapRoute("文章列表", "getarticle", new { controller = "Article", action = "GetListArticle" });
            routes.MapRoute("分页查询", "manage/article_list_{pageindex}_{pagesize}", new { controller = "Article", action = "GetListArticle" });
            routes.MapRoute("manage_category_edit", "manage/category_edit", new { controller = "Category", action = "Edit" });
            routes.MapRoute("登陆", "Loginzhn", new { controller = "Manage", action = "Login" });
            routes.MapRoute("博客", "blog", new { controller = "Home", action = "Index", id = UrlParameter.Optional });
            routes.MapRoute(
                name: "Default",
                url: "{controller}/{action}/{id}",
                defaults: new { controller = "Home", action = "Views", id = UrlParameter.Optional }
            );
        }
    }
}